import request from '@/utils/request'
import BaseApi from '../BaseApi'

/**
 * 用户模块
 */
const apiRouter = '/FaSysEnumApi'
export default class FaSysEnum extends BaseApi {
  constructor(gridId) {
    super(apiRouter, gridId)
  }

  getByCode(code) {
    return request({
      url: `${apiRouter}/getByCode/${code}`,
      method: 'get'
    })
  }

  /**
   * 添加枚举子项
   * @param {*} data
   * @param {*} enumCode
   * @param {*} name
   * @returns
   */
  addEnumItem(data, enumCode, name) {
    return request({
      url: `${apiRouter}/addEnumItem/${enumCode}/${name}`,
      method: 'post',
      data
    })
  }
  /**
   * 删除枚举子项
   * @param {*} data
   * @param {*} enumCode
   * @returns
   */
  delEnumItem(data, enumCode) {
    return request({
      url: `${apiRouter}/delEnumItem/${enumCode}`,
      method: 'post',
      data
    })
  }
}
